function model_edit(model_path, instance_id, fields) {
    $.post('http://qxb.dongpouu.com/common/model/edit',
        {
            'csrfmiddlewaretoken': $.cookie("csrftoken"),
            'model_path': model_path,
            'instance_id': instance_id,
            'fields': JSON.stringify(fields),
        }, function (res) {
            if (res.status === 0) {
                alert('修改成功!');
                location.reload()
            } else {
                alert(res.detail);
            }
        });
}

function draw_qrcode(element, url, width, height) {
    $(element).qrcode({
        width: width,
        height: height,
        render: 'canvas', //设置渲染方式 table canvas
        typeNumber: -1, //计算模式
        correctLevel: 0,//纠错等级
        background: '#ffffff',//背景颜色
        foreground: '#000000',//前景颜色
        text: url //链接
    }).slideDown();
}
